package com.ph.controller;

import com.ph.pojo.KeepProject;
import com.ph.pojo.Result;
import com.ph.service.KeepProjectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@RequestMapping("/project")
public class KeepProjectController {
    @Autowired
    private KeepProjectService keepProjectService;

    @PostMapping
    public Result add(@RequestBody KeepProject keepProject){

        return Result.success(keepProjectService.save(keepProject));
    }
    @GetMapping
    public Result findAll(@Param("keepGroupId") Integer keepGroupId){
        log.info("keepGroupId:{}",keepGroupId);
        return Result.success(keepProjectService.findAll(keepGroupId));

    }
}
